package com.kkyy.findmusic.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.kkyy.findmusic.dao.PlayListsDao;
import com.kkyy.findmusic.entity.PlayListsEntity;
import com.kkyy.findmusic.service.PlayListsService;
import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Service;

import java.math.BigInteger;
import java.util.List;

@Service
public class PlayListsServiceImpl extends ServiceImpl<PlayListsDao, PlayListsEntity> implements PlayListsService {
    @Override
    public List<PlayListsEntity> getPlayLists() {
        List<PlayListsEntity> playLists = this.baseMapper.selectByStatus();
        return playLists;
    }

    @Override
    public void delPlayListById(Integer id) {
        this.baseMapper.updatePlayListStatus(id);
    }

    @Override
    public void upPlaylistsById(Integer id) {
        baseMapper.upPlaylistsById(id);
    }

    @Override
    public void downPlaylistsById(Integer id) {
        baseMapper.downPlaylistsById(id);
    }

    @Override
    public List<PlayListsEntity> getPlayLists2() {
        List<PlayListsEntity> playLists = baseMapper.selectByStatus2();
        return playLists;
    }

    @Override
    public void addPlaylist(String copywriter, String picurl, String playlistname, BigInteger location) {
        baseMapper.insertPlaylist(copywriter, picurl, playlistname, location);
    }
}